home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Toolbox / Visual Basic Toolbox (P.I.E.)(1996).ISO / pgm_util / sealit / wizard / foo / foo.bas next >
Encoding:
BASIC Source File  |  1996-01-01  |  2.1 KB  |  60 lines

  1. Option Explicit
  2. 'Kustom Magic Software, Copyright (c) 1995, Ralph Krausse
  3. 'File Created on 1/1/96 1:53:11 PM
  4.  
  5.  
  6. 'This user-defined data type is what gets passed to the
  7. 'function declared below. All fields must be filled out
  8. Type APPINFO
  9.      bOverWriteSeal As Integer 'flag to over-write current seal
  10.      szMagicString As String * 20 'magic string, this string detects the seal if there is one
  11.      szAppName As String * 260 'Your magic string
  12. End Type
  13.  
  14.  
  15. Type Version
  16.      iMajor As Integer ' Major version
  17.      iMinor As Integer ' Minor version
  18.      iPatch As Integer ' patch version
  19.      bBeta As Integer  ' is version a beta?
  20. End Type
  21.  
  22. 'foo Type..........
  23. Type foo
  24.     bFirstTime As Integer
  25.     dtExpirationDate As Long
  26.     szCompany As String * 60
  27.     szName As String * 40
  28.     szMagicString As String * 20
  29. End Type
  30.  
  31.  
  32. Global gApplicationInfo As APPINFO
  33. Global gfoo As foo
  34.  
  35.  
  36.  
  37. 'Declarations...
  38. Declare Function ValidateApplication Lib "sealer.dll" (APPINFO As APPINFO, ByVal wSealBufferLen%, vpSealBuffer As Any) As Integer
  39. Declare Sub GetSealError Lib "sealer.dll" (ByVal wErr%, ByVal szErrorString$)
  40. Declare Function SealApplication Lib "sealer.dll" (APPINFO As APPINFO, ByVal wBufferLen%) As Integer
  41. Declare Function InitializeBuffer Lib "sealer.dll" (ByVal wLen%) As Integer
  42. Declare Sub SaveInt Lib "sealer.dll" (ByVal wValue%)
  43. Declare Sub SaveLong Lib "sealer.dll" (ByVal lValue&)
  44. Declare Sub SaveString Lib "sealer.dll" (ByVal lpszValue$, ByVal wLen%)
  45. Declare Sub DeInitializeBuffer Lib "sealer.dll" ()
  46. Declare Sub GetAPIVersion Lib "sealer.dll" (Version As Version)
  47.  
  48. 'Time conversion
  49. Declare Function ConvertDateToLong Lib "sealer.dll" (ByVal wMonth%, ByVal wDay%, ByVal wYear%) As Long
  50. Declare Function ConvertDateFromLong Lib "sealer.dll" (ByVal lTime&, wMonth%, wDay%, wYear%) As Integer
  51.  
  52. Function ConvertTime# (tmExpire&)
  53.    Dim wMonth%, wDay%, wYear%, wHour%, wMinutes%
  54.    Dim wErr%, szDateString$, szTimeString$
  55.    wErr% = ConvertDateFromLong(tmExpire&, wMonth%, wDay%, wYear%)
  56.    szDateString$ = wMonth% & "/" & wDay% & "/" & wYear%
  57.    ConvertTime# = DateValue(szDateString$)
  58. End Function
  59.  
  60.